# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Gaetan Bisson <bisson@archlinux.org>
# Contributor: Michael Kanis <mkanis gmx de>
# Contributor: Paulo Freire <paulofreire gmail com>
# Contributor: Brice Maron <brice bmaron net>

pkgname=merkaartor
pkgver=0.19.0
pkgrel=7
pkgdesc='OpenStreetMap editor'
arch=('loong64' 'x86_64')
url='http://merkaartor.be/'
license=('GPL2')
depends=('exiv2' 'gdal' 'gpsd' 'hicolor-icon-theme' 'qt5-svg')
makedepends=('qt5-tools')
source=("https://github.com/openstreetmap/$pkgname/archive/$pkgver/$pkgname-$pkgver.tar.gz"
         https://github.com/openstreetmap/merkaartor/commit/1e20d2cc.patch)
sha256sums=('f538d1eb380005cbd5d047070b276da59c58bb7ff47218e20a080b893d0ba457'
            'f99f9bdeeed46b7c452b76a0292a4155535b3b6509d542d244b4a8fef8436dee')

prepare() {
# Fix build with exiv2 0.28
  patch -d $pkgname-$pkgver -p1 < 1e20d2cc.patch
}

build() {
  cd $pkgname-$pkgver
  lrelease src/src.pro
  qmake-qt5 Merkaartor.pro PREFIX=/usr GPSDLIB=1 GEOIMAGE=1
  make
}

package() {
  cd $pkgname-$pkgver
  make INSTALL_ROOT="$pkgdir" install
}
